package com.docker.jy.service.impl;

import java.util.List;
import com.docker.common.utils.DateUtils;
import com.docker.jy.domain.dao.DailyTotalDTO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.docker.jy.mapper.DoctorOrderMapper;
import com.docker.jy.domain.DoctorOrder;
import com.docker.jy.service.IDoctorOrderService;

/**
 * 订单收费Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-04-09
 */
@Service
public class DoctorOrderServiceImpl implements IDoctorOrderService 
{
    @Autowired
    private DoctorOrderMapper doctorOrderMapper;

    /**
     * 查询订单收费
     * 
     * @param id 订单收费主键
     * @return 订单收费
     */
    @Override
    public DoctorOrder selectDoctorOrderById(Long id)
    {
        return doctorOrderMapper.selectDoctorOrderById(id);
    }

    /**
     * 查询订单收费列表
     * 
     * @param doctorOrder 订单收费
     * @return 订单收费
     */
    @Override
    public List<DoctorOrder> selectDoctorOrderList(DoctorOrder doctorOrder)
    {
        return doctorOrderMapper.selectDoctorOrderList(doctorOrder);
    }

    /**
     * 新增订单收费
     * 
     * @param doctorOrder 订单收费
     * @return 结果
     */
    @Override
    public int insertDoctorOrder(DoctorOrder doctorOrder)
    {
        doctorOrder.setCreateTime(DateUtils.getNowDate());
        return doctorOrderMapper.insertDoctorOrder(doctorOrder);
    }

    /**
     * 修改订单收费
     * 
     * @param doctorOrder 订单收费
     * @return 结果
     */
    @Override
    public int updateDoctorOrder(DoctorOrder doctorOrder)
    {
        return doctorOrderMapper.updateDoctorOrder(doctorOrder);
    }

    /**
     * 批量删除订单收费
     * 
     * @param ids 需要删除的订单收费主键
     * @return 结果
     */
    @Override
    public int deleteDoctorOrderByIds(Long[] ids)
    {
        return doctorOrderMapper.deleteDoctorOrderByIds(ids);
    }

    /**
     * 删除订单收费信息
     * 
     * @param id 订单收费主键
     * @return 结果
     */
    @Override
    public int deleteDoctorOrderById(Long id)
    {
        return doctorOrderMapper.deleteDoctorOrderById(id);
    }
   //根据每一天的日期查询所有患者的总金额,最后在前端调用这个方法,将日期传入,返回一个list集合,集合中存放的是每一天的日期和对应的总金额，然后在前端页面中使用echarts中的折线图展示
//    @Override
//    public List<DoctorOrder> selectDoctorOrderByDate(String date) {
//        return doctorOrderMapper.selectDoctorOrderByDate(date);
//    }
   public List<DailyTotalDTO> selectDoctorOrderByDate(String date) {
       return doctorOrderMapper.selectDoctorOrderByDate(date);
   }
}
